package com.lovegu.io;

import java.io.*;

/**
 * @author 老顾
 * @title: TestFile
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/24 16:11
 */
public class TestFile {
    public void testMyInput() throws Exception {
        FileInputStream fis = new FileInputStream("dbcp.txt");
        FileOutputStream fos = new FileOutputStream("dbcp5.txt");
        InputStreamReader isr = new InputStreamReader(fis, "GBK");
        OutputStreamWriter osw = new OutputStreamWriter(fos, "GBK");
        BufferedReader br = new BufferedReader(isr);
        BufferedWriter bw = new BufferedWriter(osw);
        String str = null;
        while ((str = br.readLine()) != null) {
            bw.write(str);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        br.close();
    }
}
